Skip to content

[AMDGPU] Cluster export instruction in PostRA Scheduler #141399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2025

Conversation

perlfu
Copy link
Contributor

@perlfu perlfu commented May 25, 2025

DAG mutation needs to be applied post-RA to maintain order established during pre-RA scheduler.

@perlfu perlfu requested review from jayfoad and arsenm May 25, 2025 07:55
@llvmbot
Copy link
Member

llvmbot commented May 25, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Carl Ritson (perlfu)

Changes

DAG mutation needs to be applied post-RA to maintain order established during pre-RA scheduler.


Full diff: https://github.com/llvm/llvm-project/pull/141399.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (+1)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index e24d8481408ad..7479703ce353a 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -1129,6 +1129,7 @@ GCNTargetMachine::createPostMachineScheduler(MachineSchedContext *C) const {
        getOptLevel() >= CodeGenOptLevel::Less) &&
       EnableVOPD)
     DAG->addMutation(createVOPDPairingMutation());
+  DAG->addMutation(createAMDGPUExportClusteringDAGMutation());
   return DAG;
 }
 //===----------------------------------------------------------------------===//

perlfu added a commit to perlfu/llvm-project that referenced this pull request May 25, 2025
@perlfu perlfu force-pushed the amdgpu-postra-exp-cluster branch from 35b663e to 0eb864e Compare May 25, 2025 08:17
@arsenm
Copy link
Contributor

arsenm commented May 25, 2025

Maybe this can only apply post-RA?

perlfu added a commit that referenced this pull request May 26, 2025
perlfu added 2 commits May 26, 2025 16:40
DAG mutation needs to be applied post-RA to maintain order
established during pre-RA scheduler.
@perlfu perlfu force-pushed the amdgpu-postra-exp-cluster branch from 0eb864e to fba6127 Compare May 26, 2025 07:41
@perlfu
Copy link
Contributor Author

perlfu commented May 26, 2025

Maybe this can only apply post-RA?

I think we do need to do this pre-RA as well so RA understands the liveness of the register used for the exports.

@perlfu perlfu merged commit e6b43bd into llvm:main May 26, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 26, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-key-instructions running on sie-linux-worker5 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/208/builds/1486

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'SanitizerCommon-tsan-x86_64-Linux :: vsnprintf.cpp' FAILED ********************
Exit Code: 137

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-ki/build/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=thread  -m64 -funwind-tables  -I/home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test -ldl -O2 /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/sanitizer_common/TestCases/vsnprintf.cpp -o /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Output/vsnprintf.cpp.tmp # RUN: at line 4
+ /home/buildbot/buildbot-root/llvm-ki/build/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=thread -m64 -funwind-tables -I/home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test -ldl -O2 /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/sanitizer_common/TestCases/vsnprintf.cpp -o /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Output/vsnprintf.cpp.tmp
env TSAN_OPTIONS=check_printf=1  /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Output/vsnprintf.cpp.tmp 2>&1 # RUN: at line 5
+ env TSAN_OPTIONS=check_printf=1 /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Output/vsnprintf.cpp.tmp
/home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Output/vsnprintf.cpp.script: line 2: 3113076 Killed                  env TSAN_OPTIONS=check_printf=1 /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Output/vsnprintf.cpp.tmp 2>&1

--

********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants